#include "fxcc/yml/Serializer.h"
#include "fxcc/core/graph/common/CameraData.h"

using namespace fxcc::yml;
using namespace fxcc::graph::common;


template<>
void Serializer::Encode<CameraData>(YAML::Node& node, const CameraData& inst)
{
	SetVariable<std::string>(node,"m_Name", inst.m_Name);
	SetVariable<glm::vec3>(node, "m_Position", inst.m_Position);
	SetVariable<glm::vec3>(node, "m_Up", inst.m_Up);
	SetVariable<glm::vec3>(node, "m_LookAt", inst.m_LookAt);
	SetVariable<ProjData>(node, "m_ProjData", inst.m_ProjData);
}
template<>
bool Serializer::Decode<CameraData>(const YAML::Node& node, CameraData& inst)
{
	GetVariable<std::string>(node, "m_Name", inst.m_Name);
	GetVariable<glm::vec3>(node, "m_Position", inst.m_Position);
	GetVariable<glm::vec3>(node, "m_Up", inst.m_Up);
	GetVariable<glm::vec3>(node, "m_LookAt", inst.m_LookAt);
	GetVariable<ProjData>(node, "m_ProjData", inst.m_ProjData);	
	return true;
}
